#coding=utf-8

import sys, os, getopt, ConfigParser
import global_settings

def cgi_mode():
    """如果被定义到了cgi模式下面，那么我们就轻松简单的使用cgi模式"""
    import cgi, cgitb;
    cgitb.enable = True

def usage():
    """print usage"""
    print """GPU Accelerated Puff Model Version 1.0a
CLI usage: python main.py [args]
Options:
    -h, --help: Print usage.
    -c, --conf: Specify configuration file. (Default: gapuff.conf)
"""

def runweb():
    import webfront
    webfront.app.run();

if __name__ == "__main__":
    args = sys.argv[1:]
    #default settings
    configfile = "gapuff.conf"
    try:
        opts, args = getopt.getopt(args, "h", ["help"])
    except getopt.GetoptError():
        usage()
        sys.exit(2)
    for opt, arg in opts:
        if opt in ("-h", "--help"):
            usage()
            sys.exit(-1)
    #其余的参数如何设计我还没有想好







else:
    print "This script is the main entry of GA-Puff."
    usage()
    sys.exit(3)






